﻿using LuDragon.Data.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LuDragon.IService.System
{
    /// <summary>
    /// 用户服务类接口
    /// </summary>
    public interface IUserService : IBaseService<Sys_User>
    {
        /// <summary>
        /// 获取用户实体
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="password">密码</param>
        /// <returns></returns>
        Sys_User GetUser(string userName, string password);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool Del(int id);
        /// <summary>
        /// 启用用户
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        bool Enabled(int userId);
        /// <summary>
        /// 禁用用户
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        bool Disabled(int userId);
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        bool Save(Sys_User user);

        /// <summary>
        /// 获取当前登录用户
        /// </summary>
        /// <returns></returns>
        Sys_User GetCurrentUser();

        /// <summary>
        /// 设置登录Cookie和session
        /// </summary>
        /// <param name="user"></param>
        void SetLoginCookieSession(Sys_User user);

        /// <summary>
        /// 登出
        /// </summary>
        /// <returns></returns>
        void LoginOut();
    }
}
